package mm.card.dao.model;

import java.util.Date;

import mm.card.util.AesUtil;
import mm.card.util.DateUtil;

public class CardQrcodeInfo {

	public CardQrcodeInfo() {
	}

	public CardQrcodeInfo(CardTable6 tb) throws Exception {
		this.id = tb.getId();
		this.qrcodeId = AesUtil.decrypt(tb.getAttribute1());
		this.path = AesUtil.decrypt(tb.getAttribute2());
		this.agentA = AesUtil.decrypt(tb.getAttribute3());
		this.agentARegistTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute4()));
		this.agentB = AesUtil.decrypt(tb.getAttribute5());
		this.agentBRegistTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute6()));
		this.agentC = AesUtil.decrypt(tb.getAttribute7());
		this.agentCRegistTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute8()));
		this.shop = AesUtil.decrypt(tb.getAttribute9());
		this.shopRegistTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute10()));
		this.provice = AesUtil.decrypt(tb.getAttribute11());
		this.city = AesUtil.decrypt(tb.getAttribute12());
		this.county = AesUtil.decrypt(tb.getAttribute13());
		this.isActive = Integer.valueOf(AesUtil.decrypt(tb.getAttribute14()));
		this.isValid = Integer.valueOf(AesUtil.decrypt(tb.getAttribute15()));
		this.isDelete = Integer.valueOf(AesUtil.decrypt(tb.getAttribute16()));
	}

	public CardTable6 toCardTable6() throws Exception {
		CardTable6 tb = new CardTable6();
		tb.setId(this.id);
		tb.setAttribute1(AesUtil.encrypt(this.qrcodeId));
		tb.setAttribute2(AesUtil.encrypt(this.path));
		tb.setAttribute3(AesUtil.encrypt(this.agentA));
		tb.setAttribute4(AesUtil.encrypt(DateUtil.dateTime2Str(this.agentARegistTime)));
		tb.setAttribute5(AesUtil.encrypt(this.agentB));
		tb.setAttribute6(AesUtil.encrypt(DateUtil.dateTime2Str(this.agentBRegistTime)));
		tb.setAttribute7(AesUtil.encrypt(this.agentC));
		tb.setAttribute8(AesUtil.encrypt(DateUtil.dateTime2Str(this.agentCRegistTime)));
		tb.setAttribute9(AesUtil.encrypt(this.shop));
		tb.setAttribute10(AesUtil.encrypt(DateUtil.dateTime2Str(this.shopRegistTime)));
		tb.setAttribute11(AesUtil.encrypt(this.provice));
		tb.setAttribute12(AesUtil.encrypt(this.city));
		tb.setAttribute13(AesUtil.encrypt(this.county));
		tb.setAttribute14(AesUtil.encrypt(this.isActive.toString()));
		tb.setAttribute15(AesUtil.encrypt(this.isValid.toString()));
		tb.setAttribute16(AesUtil.encrypt(this.isDelete.toString()));
		return tb;
	}

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column card_qrcode_info.id
	 *
	 * @mbggenerated
	 */
	private Long id;

	/**
	 * 二维码ID
	 *
	 * @mbggenerated
	 */
	private String qrcodeId;

	/**
	 * 磁盘路径
	 *
	 * @mbggenerated
	 */
	private String path;

	/**
	 * A级代理
	 *
	 * @mbggenerated
	 */
	private String agentA;

	/**
	 * 分发给代理商A的时间
	 *
	 * @mbggenerated
	 */
	private Date agentARegistTime;

	/**
	 * B级代理
	 *
	 * @mbggenerated
	 */
	private String agentB;

	/**
	 * 分发给代理商B的时间
	 *
	 * @mbggenerated
	 */
	private Date agentBRegistTime;

	/**
	 * C级代理
	 *
	 * @mbggenerated
	 */
	private String agentC;

	/**
	 * 分发给代理商C的时间
	 *
	 * @mbggenerated
	 */
	private Date agentCRegistTime;

	/**
	 * 商铺ID
	 *
	 * @mbggenerated
	 */
	private String shop;

	/**
	 * 商铺注册的时间
	 *
	 * @mbggenerated
	 */
	private Date shopRegistTime;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column card_qrcode_info.provice
	 *
	 * @mbggenerated
	 */
	private String provice;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column card_qrcode_info.city
	 *
	 * @mbggenerated
	 */
	private String city;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column card_qrcode_info.county
	 *
	 * @mbggenerated
	 */
	private String county;

	/**
	 * 是否激活
	 *
	 * @mbggenerated
	 */
	private Integer isActive;

	/**
	 * 是否有效
	 *
	 * @mbggenerated
	 */
	private Integer isValid;

	/**
	 * 是否删除
	 *
	 * @mbggenerated
	 */
	private Integer isDelete;

	/**
	 * 获取
	 *
	 * @return id
	 *
	 * @mbggenerated
	 */
	public Long getId() {
		return id;
	}

	/**
	 * 设置
	 *
	 * @param id
	 *
	 * @mbggenerated
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * 获取二维码ID
	 *
	 * @return qrcodeId 二维码ID
	 *
	 * @mbggenerated
	 */
	public String getQrcodeId() {
		return qrcodeId;
	}

	/**
	 * 设置二维码ID
	 *
	 * @param qrcodeId
	 *            二维码ID
	 *
	 * @mbggenerated
	 */
	public void setQrcodeId(String qrcodeId) {
		this.qrcodeId = qrcodeId == null ? null : qrcodeId.trim();
	}

	/**
	 * 获取磁盘路径
	 *
	 * @return path 磁盘路径
	 *
	 * @mbggenerated
	 */
	public String getPath() {
		return path;
	}

	/**
	 * 设置磁盘路径
	 *
	 * @param path
	 *            磁盘路径
	 *
	 * @mbggenerated
	 */
	public void setPath(String path) {
		this.path = path == null ? null : path.trim();
	}

	/**
	 * 获取A级代理
	 *
	 * @return agentA A级代理
	 *
	 * @mbggenerated
	 */
	public String getAgentA() {
		return agentA;
	}

	/**
	 * 设置A级代理
	 *
	 * @param agentA
	 *            A级代理
	 *
	 * @mbggenerated
	 */
	public void setAgentA(String agentA) {
		this.agentA = agentA == null ? null : agentA.trim();
	}

	/**
	 * 获取分发给代理商A的时间
	 *
	 * @return agentARegistTime 分发给代理商A的时间
	 *
	 * @mbggenerated
	 */
	public Date getAgentARegistTime() {
		return agentARegistTime;
	}

	/**
	 * 设置分发给代理商A的时间
	 *
	 * @param agentARegistTime
	 *            分发给代理商A的时间
	 *
	 * @mbggenerated
	 */
	public void setAgentARegistTime(Date agentARegistTime) {
		this.agentARegistTime = agentARegistTime;
	}

	/**
	 * 获取B级代理
	 *
	 * @return agentB B级代理
	 *
	 * @mbggenerated
	 */
	public String getAgentB() {
		return agentB;
	}

	/**
	 * 设置B级代理
	 *
	 * @param agentB
	 *            B级代理
	 *
	 * @mbggenerated
	 */
	public void setAgentB(String agentB) {
		this.agentB = agentB == null ? null : agentB.trim();
	}

	/**
	 * 获取分发给代理商B的时间
	 *
	 * @return agentBRegistTime 分发给代理商B的时间
	 *
	 * @mbggenerated
	 */
	public Date getAgentBRegistTime() {
		return agentBRegistTime;
	}

	/**
	 * 设置分发给代理商B的时间
	 *
	 * @param agentBRegistTime
	 *            分发给代理商B的时间
	 *
	 * @mbggenerated
	 */
	public void setAgentBRegistTime(Date agentBRegistTime) {
		this.agentBRegistTime = agentBRegistTime;
	}

	/**
	 * 获取C级代理
	 *
	 * @return agentC C级代理
	 *
	 * @mbggenerated
	 */
	public String getAgentC() {
		return agentC;
	}

	/**
	 * 设置C级代理
	 *
	 * @param agentC
	 *            C级代理
	 *
	 * @mbggenerated
	 */
	public void setAgentC(String agentC) {
		this.agentC = agentC == null ? null : agentC.trim();
	}

	/**
	 * 获取分发给代理商C的时间
	 *
	 * @return agentCRegistTime 分发给代理商C的时间
	 *
	 * @mbggenerated
	 */
	public Date getAgentCRegistTime() {
		return agentCRegistTime;
	}

	/**
	 * 设置分发给代理商C的时间
	 *
	 * @param agentCRegistTime
	 *            分发给代理商C的时间
	 *
	 * @mbggenerated
	 */
	public void setAgentCRegistTime(Date agentCRegistTime) {
		this.agentCRegistTime = agentCRegistTime;
	}

	/**
	 * 获取商铺ID
	 *
	 * @return shop 商铺ID
	 *
	 * @mbggenerated
	 */
	public String getShop() {
		return shop;
	}

	/**
	 * 设置商铺ID
	 *
	 * @param shop
	 *            商铺ID
	 *
	 * @mbggenerated
	 */
	public void setShop(String shop) {
		this.shop = shop == null ? null : shop.trim();
	}

	/**
	 * 获取商铺注册的时间
	 *
	 * @return shopRegistTime 商铺注册的时间
	 *
	 * @mbggenerated
	 */
	public Date getShopRegistTime() {
		return shopRegistTime;
	}

	/**
	 * 设置商铺注册的时间
	 *
	 * @param shopRegistTime
	 *            商铺注册的时间
	 *
	 * @mbggenerated
	 */
	public void setShopRegistTime(Date shopRegistTime) {
		this.shopRegistTime = shopRegistTime;
	}

	/**
	 * 获取
	 *
	 * @return provice
	 *
	 * @mbggenerated
	 */
	public String getProvice() {
		return provice;
	}

	/**
	 * 设置
	 *
	 * @param provice
	 *
	 * @mbggenerated
	 */
	public void setProvice(String provice) {
		this.provice = provice == null ? null : provice.trim();
	}

	/**
	 * 获取
	 *
	 * @return city
	 *
	 * @mbggenerated
	 */
	public String getCity() {
		return city;
	}

	/**
	 * 设置
	 *
	 * @param city
	 *
	 * @mbggenerated
	 */
	public void setCity(String city) {
		this.city = city == null ? null : city.trim();
	}

	/**
	 * 获取
	 *
	 * @return county
	 *
	 * @mbggenerated
	 */
	public String getCounty() {
		return county;
	}

	/**
	 * 设置
	 *
	 * @param county
	 *
	 * @mbggenerated
	 */
	public void setCounty(String county) {
		this.county = county == null ? null : county.trim();
	}

	/**
	 * 获取是否激活
	 *
	 * @return isActive 是否激活
	 *
	 * @mbggenerated
	 */
	public Integer getIsActive() {
		return isActive;
	}

	/**
	 * 设置是否激活
	 *
	 * @param isActive
	 *            是否激活
	 *
	 * @mbggenerated
	 */
	public void setIsActive(Integer isActive) {
		this.isActive = isActive;
	}

	/**
	 * 获取是否有效
	 *
	 * @return isValid 是否有效
	 *
	 * @mbggenerated
	 */
	public Integer getIsValid() {
		return isValid;
	}

	/**
	 * 设置是否有效
	 *
	 * @param isValid
	 *            是否有效
	 *
	 * @mbggenerated
	 */
	public void setIsValid(Integer isValid) {
		this.isValid = isValid;
	}

	/**
	 * 获取是否删除
	 *
	 * @return isDelete 是否删除
	 *
	 * @mbggenerated
	 */
	public Integer getIsDelete() {
		return isDelete;
	}

	/**
	 * 设置是否删除
	 *
	 * @param isDelete
	 *            是否删除
	 *
	 * @mbggenerated
	 */
	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}
}